﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcApplication1.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult LoadMenuData()
        {
            var menu = new object[]
                {
                    new {text = "工作台", iconCls = "icon-book-tabs",children = new object[]
                        {
                            new {text = "待处理任务",iconCls = "icon-clipboard"}
                        }},
                    new {text = "房产管理", iconCls = "icon-house"},
                    new {text = "客商管理", iconCls = "icon-group",attributes = new { u = "/Customer/Index"}},
                    new {text = "合同管理", iconCls = "icon-page"},
                    new {text = "收款管理", iconCls = "icon-coins-add"},
                    new {text = "付款管理", iconCls = "icon-coins-delete"},
                    new {text = "报表统计", iconCls = "icon-chart-bar",children = new object[]
                        {
                            new {text = "财务报表"},
                            new {text = "业务报表"},
                        }},
                    new {text = "系统管理", iconCls = "icon-settings",children = new object[]
                        {
                            new {text = "用户管理",iconCls = "icon-group"},
                        }}
                };
            return Json(menu, JsonRequestBehavior.AllowGet);
        }

        public string GetClientIp()
        {
            string ip = "0.0.0.0";
            return  ip;
        }
    }
}
